/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author bluepc
 */
@Entity
@Table(name = "FoodType")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FoodType.findAll", query = "SELECT f FROM FoodType f"),
    @NamedQuery(name = "FoodType.findByIdFoodtype", query = "SELECT f FROM FoodType f WHERE f.idFoodtype = :idFoodtype"),
    @NamedQuery(name = "FoodType.findByFoodtypeName", query = "SELECT f FROM FoodType f WHERE f.foodtypeName = :foodtypeName"),
    @NamedQuery(name = "FoodType.findByFoodtypeStatus", query = "SELECT f FROM FoodType f WHERE f.foodtypeStatus = :foodtypeStatus")})
public class FoodType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer idFoodtype;
    @Size(max = 250)
    @Column(name = "foodtype_name")
    private String foodtypeName;
    @Column(name = "foodtype_status")
    private Boolean foodtypeStatus;
    @OneToMany(mappedBy = "idFoodtype")
    private List<Dish> dishList;

    public FoodType() {
    }

    public FoodType(Integer idFoodtype) {
        this.idFoodtype = idFoodtype;
    }

    public Integer getIdFoodtype() {
        return idFoodtype;
    }

    public void setIdFoodtype(Integer idFoodtype) {
        this.idFoodtype = idFoodtype;
    }

    public String getFoodtypeName() {
        return foodtypeName;
    }

    public void setFoodtypeName(String foodtypeName) {
        this.foodtypeName = foodtypeName;
    }

    public Boolean getFoodtypeStatus() {
        return foodtypeStatus;
    }

    public void setFoodtypeStatus(Boolean foodtypeStatus) {
        this.foodtypeStatus = foodtypeStatus;
    }

    @XmlTransient
    public List<Dish> getDishList() {
        return dishList;
    }

    public void setDishList(List<Dish> dishList) {
        this.dishList = dishList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFoodtype != null ? idFoodtype.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FoodType)) {
            return false;
        }
        FoodType other = (FoodType) object;
        if ((this.idFoodtype == null && other.idFoodtype != null) || (this.idFoodtype != null && !this.idFoodtype.equals(other.idFoodtype))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.FoodType[ idFoodtype=" + idFoodtype + " ]";
    }
    
}
